import java.util.Scanner;

public class Triangle {

	private double a, b, c;

	public Triangle(int aa, int bb, int cc) {
		a = aa;
		b = bb;
		c = cc;
	}

	public Triangle(double aa, double bb, double cc) {
		a = aa;
		b = bb;
		c = cc;
	}

	public String triangleType() {
		//inequality theorem check & positive check
		if (a <= 0 || b <= 0 || c <= 0
		    || (c >= a + b))
			return "invalid";
		else if (a == b && b == c)
			return "equilateral";
		else if (a == b || b == c || a == c)
			return "isosceles";
		else
			return "scalene";
	}

	public boolean isRightTriangle() {
		if (a <= 0 || b <= 0 || c <= 0)
			return false;

		//Pythagorean theorem check
		return tolerantEquals(c*c, (a*a + b*b));
	}

	public boolean tolerantEquals(double a, double b) {
		double diff;

		diff = a-b;
		if (diff < 0)
			diff = -diff;

		//check for equality within a tolerance
		if (diff < 0.05)
			return true;

		return false;
	}

	public static void main(String[] args) {
		double a = 0;
		double b = 0;
		double c = 0;
		double max = 0;

		Triangle t;

		Scanner sc = new Scanner(System.in);

		try {
			System.out.println("Enter the length of the first side of the triangle: ");
			a = Double.parseDouble(sc.nextLine());
			System.out.println("Enter the length of the second side of the triangle: ");
			b = Double.parseDouble(sc.nextLine());
			System.out.println("Enter the length of the third side of the triangle: ");
			c = Double.parseDouble(sc.nextLine());
		} catch(NumberFormatException e) {
			System.out.println("Incorrect input. Please provide positive numbers.");
			System.exit(1);
		}

		if (a <= 0 || b <= 0 || c <= 0) {
			System.out.println("Incorrect input. Please provide positive numbers.");
			System.exit(1);
		}

		//get maximum length side (hypotenuse) and make it c
		if (a >= b && a >= c)
			t = new Triangle(b, c, a);
		else if (b >= a && b >= c)
			t = new Triangle(a, c, b);
		else
			t = new Triangle(a, b, c);
			
		System.out.println();
		System.out.print(t.triangleType());
		if (t.isRightTriangle())
			System.out.print(" right");
		System.out.println(" triangle");
	}

}
